﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace AlarmMusik
{
    class IniHelper
    {
        private static string configName = "AlarmMusik.ini";

        private string getApplicationPath()
        {
            string appPath = Path.GetDirectoryName(Application.ExecutablePath);
            return appPath;
        }

        public string read(string section, string key)
        {
            IniHandle iniHandle = new IniHandle(getApplicationPath()+"\\"+configName);
            return iniHandle.IniReadValue(section, key);
        }

        public void write(string section, string key, string value)
        {
            IniHandle iniHandle = new IniHandle(getApplicationPath() + "\\" + configName);
            iniHandle.IniWriteValue(section, key, value);
        }
    }
}
